package cn.rumoss.io.network;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

/**
 * @ClassName UDPSend
 * @Description //TODO
 * @Author HeCG
 * @Date 19-4-22 下午3:38
 */
public class UDPSend {

    public static void main(String[] args) throws Exception {

        byte[] msg = new String("UPDATE").getBytes();
        int port = 23333;
        InetAddress inetAddr = InetAddress.getByName("255.255.255.255");
        DatagramSocket client = new DatagramSocket();

        DatagramPacket sendPacket = new DatagramPacket(msg, msg.length, inetAddr, port);
        client.send(sendPacket);
        client.close();
        System.out.println("Send close");

    }

}
